


<style>
    .request_data_table input{width: 80px!important;padding-left: 10px;}
    .reward-tab{padding: 10px;height: 100%;width: 849px;margin-left: 69px;}
    .share-reward input{margin-top:20px;}
    .add-share,.add-team{cursor: pointer;background-color: rgb(0,166,90); display:inline-block;text-align: center;font-size: 20px; line-height: 22px;width: 22px}
    .reduce-share,.reduce-team{cursor: pointer;background-color:  rgb(221,75,57); display:inline-block;text-align: center;font-size: 20px; line-height: 22px;width: 22px}
</style>


<div class="x-body">
    <div class="layui-form form_single" id="form" action="{:url()}" method="post">
        <div class="layui-form-item">
            <label for="template_name" class="layui-form-label">
                <span class="x-red">*</span>模板名称
            </label>
            <div class="layui-input-block">
                <input type="text" id="template_name" name="template_name" onchange="this.value=this.value.substring(0, 30)" onkeydown="this.value=this.value.substring(0, 30)" onkeyup="this.value=this.value.substring(0, 30)"  required="" lay-verify="required"
                       autocomplete="off"  value="{$info['template_name']|default=''}" class="layui-input">
            </div>
            <div style="color: red !important;" class="layui-form-mid layui-word-aux">
                （限制30字符）
            </div>
        </div>

        <div class="layui-form-item">
            <label for="describe" class="layui-form-label">
                备注
            </label>
            <div class="layui-input-block">
                <textarea id="describe" class="layui-textarea" name="remark" maxlength="200" onchange="this.value=this.value.substring(0, 200)" onkeydown="this.value=this.value.substring(0, 200)" onkeyup="this.value=this.value.substring(0, 200)"    rows="3" placeholder="请输入备注">{$info['remark']|default=''}</textarea>
            </div>
            <!--<div class="layui-form-mid layui-word-aux">-->
            <!--(文章描述信息/简介)-->
            <!--</div>-->
        </div>


        <table class="layui-table x-admin">
            <thead>
            <tr>

                <th>商铺名称</th>
                <th>商铺完成单数</th>
                <th>商铺总单数</th>
                <th>商铺订单总额</th>
                <th>商铺利润</th>
                <th>商铺总价</th>
                <th>手续费</th>
                <th>  <b class="add-share add-table" >+</b></a>&nbsp;&nbsp;  <b class="reduce-share reduce-table" >-</b></th>
            </tr>
            </thead>

            <tbody class="table-body" >
            {if condition="isset($info) eq true"}
            {volist name='info.content' id='vo'}
            <tr class="table-data">
                <td><input type="text" name="username[]" value="{$vo.shop_name}"></td>
                <td><input type="number" name="recharge[]" value="{$vo.success_order_count}"></td>
                <td><input type="number" name="profit[]" value="{$vo.order_count}"></td>
                <td><input type="number" name="entrust[]" value="{$vo.order_total}"></td>
                <td><input type="number" name="withdrwal[]" value="{$vo.profit}"></td>
                <td><input type="number" name="total_price[]" value="{$vo.total_price|default=0}"></td>
                <td><input type="number" name="poundage_number[]" value="{$vo.poundage_number}"></td>
                <td>  <b class="add-share add-tr" >+</b></a>&nbsp;&nbsp;  <b class="reduce-share reduce-tr" >-</b></td>
            </tr>

            {/volist}
            {else/}
            <tr class="table-data">
                <td><input type="text" name="username[]"></td>
                <td><input type="number" name="recharge[]" value="0"></td>
                <td><input type="number" name="profit[]" value="0"></td>
                <td><input type="number" name="entrust[]" value="0"></td>
                <td><input type="number" name="withdrwal[]" value="0"></td>
                <td><input type="number" name="total_price[]" value="0"></td>
                <td><input type="number" name="poundage_number[]" value="0"></td>
                <td>  <b class="add-share add-tr" >+</b></a>&nbsp;&nbsp;  <b class="reduce-share reduce-tr" >-</b></td>
            </tr>
            {/if}
            </tbody>
        </table>














        <div class="box-footer">
            <input type="hidden" name="type" value="{$type}"/>
            <input type="hidden" name="id" value="{$info['id']|default='0'}"/>

            {include file="layout/edit_btn_group"/}

        </div>

</form>
</div>
</div>
<script>
    $('.x-admin').on('click','.add-table',(function () {

        var html= '  <tr class="table-data"> <td><input type="text" name="username[]" ></td> <td><input type="number" name="recharge[]" value="0"></td> <td><input type="number" name="profit[]" value="0"></td> <td><input type="number" name="entrust[]" value="0"></td> <td><input type="number" name="withdrwal[]" value="0"></td>     <td><input type="number" name="total_price[]" value="0"></td>  <td><input type="number" name="poundage_number[]" value="0"></td><td>  <b class="add-share add-tr" >+</b></a>&nbsp;&nbsp;  <b class="reduce-share reduce-tr" >-</b></td> </tr>';

            $('.table-body').append(html);

    }))

    $('.x-admin').on('click','.reduce-table',(function () {



    $('.table-data').last().remove();

    }))

    $('.x-admin').on('click','.add-tr',(function () {

        var html= '  <tr class="table-data"> <td><input type="text" name="username[]" ></td> <td><input type="number" name="recharge[]" value="0"></td> <td><input type="number" name="profit[]" value="0"></td> <td><input type="number" name="entrust[]" value="0"></td> <td><input type="number" name="withdrwal[]" value="0"></td>    <td><input type="number" name="total_price[]" value="0"></td>   <td><input type="number" name="poundage_number[]" value="0"></td><td>  <b class="add-share add-tr" >+</b></a>&nbsp;&nbsp;  <b class="reduce-share reduce-tr" >-</b></td> </tr>';

        $(this).parent().parent().after(html);

    }))
    $('.x-admin').on('click','.reduce-tr',(function () {



        $(this).parent().parent().remove();
    }))


</script>
